﻿namespace EyeOpen.Web.Security
{
    using EyeOpen.Dependency;
    using EyeOpen.SecurityService;
    using EyeOpen.Util;

    public class DependencyMembershipProvider : FakeMembershipProvider
    {
        public override bool ValidateUser(string username, string password)
        {
            string passwordHash = SecurityUtility.ComputeBase64MD5Hash(password);

            bool isValidaUser = false;

            isValidaUser = 
                DependencyContainer
                .Resolve<IMembershipSecurityService>()
                .IsValidUser(username, passwordHash);

            return isValidaUser; 
        }
    }
}